package com.hexacta.hrs.services.exchange.impl;

import java.util.Collection;

import com.hexacta.hrs.domain.exchange.Exchange;
import com.hexacta.hrs.repositories.exchange.ExchangeRepository;
import com.hexacta.hrs.services.exchange.ExchangeService;

public class ExchangeServiceImpl implements ExchangeService {
    private ExchangeRepository exchangeRepository;

    public ExchangeRepository getExchangeRepository() {
        return exchangeRepository;
    }

    public void setExchangeRepository(final ExchangeRepository exchangeRepository) {
        this.exchangeRepository = exchangeRepository;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public Exchange searchById(final long id) {
        return exchangeRepository.forId(id);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public void save(final Exchange recordObject) {
        exchangeRepository.save(recordObject);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public void delete(final Exchange recordObject) {
        exchangeRepository.delete(recordObject);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public Collection<Exchange> searchByCriteria(final Exchange criteria) {
        return exchangeRepository.matching(criteria);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public Exchange createNew() {
        return new Exchange();
    }

}
